gusucode.com > 忠网网站广告管理系统 ZonGG V1.3 > 忠网网站广告管理系统 ZonGG V1.3\code\GGplaceQlx.asp

    <!-- #INCLUDE FILE="login.asp" -->

<head>
<meta http-equiv="Content-Language" content="zh-cn">
</head>

<%
if xmltype=1 then  response.redirect "GGplaceQl.asp?pid="&trim(request("pid"))

	'///*********************************
	'   广告位清理程序
	'********************************///
	Call AdminQx(3,GgPlaceflid(trim(request("pid"))))

	action=trim(request("action"))
	Dim dqw
	
	dqw="清理ID为"&trim(request("pid"))&"的广告位相关信息"&" [<a href=javascript:opw('GGplaceCz.asp?a=Yl&id="&request.querystring("id")&"','ZonGG"&request.querystring("id")&"',800,600)>预览</a>]"
	Call Heads_GGclass(dqw)
	
	if not isnumeric(trim(request("pid"))) then
	response.write "错误:广告位ID无效!"
	response.end
	else
	pid = trim(request("pid"))
	end if
	  

Rs1.open "select * from place where Pid="&pid,conn,3,3,1

		Pid=Rs1(0)
		Pname=Rs1(1)
		Plei=Rs1(2)
		Pcss=Rs1(3)
		Cid=Rs1(4)
		ADids=Rs1(5)
Rs1.close
 		

if action="yes" then '' 开始执行清理程序
		
			if trim(request("sc"))="yes" then  '' 如果是删除广告位清理		 
		 	conn.execute("delete from Place where Pid="&pid)
		 	
			adidss=trim(request("ADids"))
			
		 	''
		 	'' 如果  adidss<>""  执行删除各选中广告条的操作
		 	''
		 	
			 	if adidss<>"" then
					
					adidsss=split(adidss&",",",")
					
					for i=0 to Ubound(adidsss)-1
							 	
					pids=GgtiaoPids(adidsss(i))	  '' 得到广告条所属广告位id列表
					call GgtiaoDelete(adidsss(i),pids)  '' 执行广告条删除
					  
					next
				adidsxs="->> ID为 "&adidss&" 的广告条所有相关信息被删除<br><BR>"
				end if
					
			
			
							
			 '' 显示提示信息
			 response.write "<b>删除当前广告位,并对其进行了如下清理:</b><BR><BR>"&adidsxs
			
			 response.write "[<a href='GGclass.asp?'>返回列表</a>]"		
			
			else '' 如果是保留广告位清理
			
			adidss=trim(request("ADids1"))
			
		 	''
		 	'' 如果  adidss<>""  执行取消广告位与各选中广告条的关联操作
		 	''
		 	
		    if adidss<>"" then
			  
			adidsxs="->> 取消了跟ID为 "&adidss&" 广告条的关联<BR><BR>"
				 	
				'' 将广告位ID循环从选中的各广告条移出,同时将选中的广告条ID从 adids 中移出
				'' Dim adidsss,adidss1
				
				adidsss=split(adidss&",",",")
				
				for i=0 to Ubound(adidsss)-1
				
				if isnumeric(adidsss(i)) then
				
				  rs.open "select Pids,ADname from Advertisement where Adid="&cint(adidsss(i)),conn,3,3,1
				   
				   if instr(rs(0),",")>0 then
				    if instr(rs(0),Pid&",")>0 then
				     rs(0)=replace(rs(0),Pid&",","")
				     rs.update
				    else
				     rs(0)=replace(rs(0),","&Pid,"")
				     rs.update
				    end if
				   else
				     rs(0)=""
				     rs.update
				   end if
				
				  rs.close	
				  		
				  
				 '' 清除 ADids 中的选中广告条 id adidsss(i) 得到最后更新的 ADids			 	 
			 
				 if instr(ADids,",")>0 then
				    if instr(ADids,adidsss(i)&",")>0 then
				     ADids=replace(ADids,adidsss(i)&",","")
				    else
				     ADids=replace(ADids,","&adidsss(i),"")			     
				    end if
				 else
				 
				     ADids=""			     
				 end if
				   				  						   
				'''''''  

				 end if				
				next	
				
				 '' 新 ADids 入仓				 
				 conn.execute("update Place set ADids='"&ADids&"' where Pid="&Pid)				
			
			 '' 显示提示信息
			 response.write "<b>保留当前广告位,并对其进行了如下清理:</b><BR><BR>"&adidsxs
			 response.write "[<a href='GGclass.asp?'>返回列表</a>] [<a href='GGplaceQl.asp?pid="&Pid&"'>再次清理</a>]"
				 
			 end if			
 

		 	 end if		
		 	 
	   else '' 开始清理界面
	   
 
		
		%><div align="center">
			<table width="580" id="table1"  border=1 cellspacing=0 cellpadding=2 bordercolorlight=#C0C0C0 bordercolordark=#FFFFFF bgcolor=#ffffff>
			<form method="POST" action="?action=yes&pid=<%=Pid%>">
			<tr>
				<td  class="td1" height="30"><input type="radio" value="yes" name="sc">删除广告位,同时删除以下选中的广告条(可以不选,也可以全选)</td>
			</tr>
			<tr>
				<td>
				<%dim ADidss
		          if Trim(ADids)<>"" then
		          ADidss=split(ADids&",",",")
		          For i=0 To Ubound(ADidss)-1
		          response.write "&nbsp;&nbsp;<input type='checkbox' name='ADids' value='"&ADidss(i)&"'><font class=red> "&i+1&". </font>"
		          call GgtiaoXsName(ADidss(i))
		          response.write " <br> "          
		          next
		          end if
		        %>	
					</td>
			</tr>
			<tr>
				<td  class="td1" height="30"> 
					<input type="radio" value="no" checked name="sc">保留广告位,取消与以下选中广告条的关联(可多选)</td>
			</tr>
			<tr>
				<td>
				<%ADidss=""
		          if Trim(ADids)<>"" then
		          ADidss=split(ADids&",",",")
		          For i=0 To Ubound(ADidss)-1
		          response.write "&nbsp;&nbsp;<input type='checkbox' name='ADids1' value='"&ADidss(i)&"'><font class=red> "&i+1&". </font>"
		          call GgtiaoXsName(ADidss(i))
		          response.write " <br> "          
		          next
		          end if
		        %>	
					</td>
			</tr>
			<tr>
				<td height="30">
				<p align="center"><input type="submit" value="执行清理" name="B1"></td>
			</tr>
			<tr>
				<td align="center"> </td>
			</tr></form>
		</table>
		</div>
		
<%end if%>